package com.ShangGuiGu.recursion;

/**
 * @auther zsj
 * @Date 2022/1/13
 * <p>
 * 递归
 **/
public class RecursionDemo {
    public static void main(String[] args) {
        int i = recursionMethod(4);
        System.out.println(i);
    }

    public static int recursionMethod(int value) {
        if (value == 2) {
            return value;
        } else {
            return recursionMethod(value-1);
        }
    }
}
